package jsyf.oa.entity.app;

import com.alibaba.fastjson.JSONObject;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.Table;

import jsyf.oa.ientity.BaseEntity;

@Entity
@Table(name = "T_APP_UPDATE", schema = "oa", catalog = "")
public class UpdateEntity extends BaseEntity {

    /**
     * 版本号 <p>code 判断升级的标识</p>
     */
    private int versionCode;
    /**
     * 版本名称 <p>v1.0.21.6</p>
     */
    private String versionName;
    /**
     * apk大小 <p>18M</p>
     */
    private String apkSize;
    /**
     * 更新说明 <p>修复了一些bug;多个说明用分号隔开</p>
     */
    private String remark;
    /**
     * 是否强制升级 <p>0不强制 1强制</p>
     */
    private String forceFlag;
    /**
     * 是否可忽略该版本 <p>0可忽略 1不可忽略</p>
     */
    private String ignoreFlag;
    private Date createTime;
    private String userIds;
    private String roleIds;
    private String departIds;
    private String companyIds;

    @Override
    public JSONObject getJSONObject() {
        JSONObject obj = new JSONObject();
        obj.put("ID", id);
        obj.put("VERSION_CODE", versionCode);
        obj.put("VERSION_NAME", versionName);
        obj.put("APK_SIZE", apkSize);
        obj.put("REMARK", remark);
        obj.put("FORCE_FLAG", forceFlag);
        obj.put("IGNORE_FLAG", ignoreFlag);
        obj.put("CREATE_TIME", createTime);
        obj.put("USER_IDS", userIds);
        obj.put("ROLE_IDS", roleIds);
        obj.put("DEPART_IDS", departIds);
        obj.put("COMPANY_IDS", companyIds);
        return obj;
    }

    @Override
    public String getTableName() {
        return "T_APP_UPDATE";
    }

    @Override
    public JSONObject getJSONColumns() {
        JSONObject obj = new JSONObject();
        obj.put("ID", "id");
        obj.put("VERSION_CODE", "versionCode");
        obj.put("VERSION_NAME", "versionName");
        obj.put("APK_SIZE", "apkSize");
        obj.put("REMARK", "remark");
        obj.put("FORCE_FLAG", "forceFlag");
        obj.put("IGNORE_FLAG", "ignoreFlag");
        obj.put("CREATE_TIME", "createTime");
        obj.put("USER_IDS", "userIds");
        obj.put("ROLE_IDS", "roleIds");
        obj.put("DEPART_IDS", "departIds");
        obj.put("COMPANY_IDS", "companyIds");
        return obj;
    }


    public int getVersionCode() {
        return versionCode;
    }

    public void setVersionCode(int versionCode) {
        this.versionCode = versionCode;
    }

    public String getVersionName() {
        return versionName;
    }

    public void setVersionName(String versionName) {
        this.versionName = versionName;
    }

    public String getApkSize() {
        return apkSize;
    }

    public void setApkSize(String apkSize) {
        this.apkSize = apkSize;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getForceFlag() {
        return forceFlag;
    }

    public void setForceFlag(String forceFlag) {
        this.forceFlag = forceFlag;
    }

    public String getIgnoreFlag() {
        return ignoreFlag;
    }

    public void setIgnoreFlag(String ignoreFlag) {
        this.ignoreFlag = ignoreFlag;
    }

    @Override
    public Date getCreateTime() {
        return createTime;
    }

    @Override
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getUserIds() {
        return userIds;
    }

    public void setUserIds(String userIds) {
        this.userIds = userIds;
    }

    public String getRoleIds() {
        return roleIds;
    }

    public void setRoleIds(String roleIds) {
        this.roleIds = roleIds;
    }

    public String getDepartIds() {
        return departIds;
    }

    public void setDepartIds(String departIds) {
        this.departIds = departIds;
    }

    public String getCompanyIds() {
        return companyIds;
    }

    public void setCompanyIds(String companyIds) {
        this.companyIds = companyIds;
    }
}
